package com.example.java_chatroom1.server;

import com.example.java_chatroom1.mapper.MessageInfoMapper;
import com.example.java_chatroom1.model.MessageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MessageInfoService {
    @Autowired
    private MessageInfoMapper messageInfoMapper;

    public String getLastMessageBySessionId(Integer sessionId) {
        return messageInfoMapper.getLastMessageBySessionId(sessionId);
    }

    public List<MessageInfo> getMessageInfosBySessionId(Integer sessionId) {
        return messageInfoMapper.getMessageInfosBySessionId(sessionId);
    }
}
